package demo2;

public class Test {
    public static void eat(Animal animal) {
        animal.eat();
    }
    public static void fly(IFly fly) {
        fly.fly();
    }
    public static void main(String[] args) {
        Dog dog = new Dog("旺财");
        Duck duck = new Duck("唐老鸭");
        eat(dog);
        eat(duck);

        fly(duck);
    }
}
